package sh.action;

import com.opensymphony.xwork2.ActionSupport;
import lombok.Data;
import sh.service.MessageService;
import sh.service.impl.MessageServiceImpl;
import sh.util.SessionUtil;

@Data
public class LeaveMessageAction extends ActionSupport {
	private String message;

	private String userName;

	/**
	 * 卖方的id
	 */
	private Long seller ;
	
	public String sendMessage(){
		MessageService messageService = new MessageServiceImpl();
		if(messageService.sendMessage(seller, SessionUtil.getCurrentUserId(), message)){
			return "success";
		}
		return "fail";
	}

	@Override
	public String execute(){
		
			return "success";
		
	}

	public String getMessage() {
		return message;
	}

	public String getUserName() {
		return userName;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
}
